 //*************************************************************************
 //  Counter.java              Author:20172323wyh
 //  
 //  Count the number of people entering the room. 
 //*************************************************************************

 public class Counter
 {
    public static void main(String[] args)
    {}
    private int peoplenumber;
    
    //---------------------------------------------------------------------
    // Counstructor: Sets the initial peoplenumber.
    //---------------------------------------------------------------------
    public Counter()
    {
       peoplenumber = 0;
    }

    //---------------------------------------------------------------------
    // Add one based on the last peoplenumber.
    //---------------------------------------------------------------------
    public int click()
    {
       peoplenumber = peoplenumber + 1;
       return peoplenumber;
    }

    //---------------------------------------------------------------------
    // Return current peoplenumber.
    //---------------------------------------------------------------------
    public int getCount()
    {
       return peoplenumber;
    }

    //---------------------------------------------------------------------
    // Set the peoplenumber back to 0.
    //---------------------------------------------------------------------
    public int reset()
    {
       peoplenumber = peoplenumber * 0;
       return peoplenumber;
    }

    //---------------------------------------------------------------------
    // Returns a string representation of this counter.
    //---------------------------------------------------------------------
    public String toString()
    {
       String result = Integer.toString(peoplenumber);

       return result;
    }
  }
